/*
 * @Author: anxia.ack anchenkai@come-future.com
 * @Date: 2025-04-16 20:49:02
 * @LastEditors: anxia.ack anchenkai@come-future.com
 * @LastEditTime: 2025-04-16 22:50:32
 * @FilePath: /free-learning/src/api/system/carousel/index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from "@/utils/request";
import type { Carousel } from "./type";

const BASE_URL = "/api/v1/carousel";

export const getCarouselList = () => {
  return request.get(BASE_URL + "/allList");
};

export const addCarousel = (carousel: Carousel) => {
  return request.post(BASE_URL + "/add", carousel);
};

export const editCarousel = (carousel: Carousel) => {
  return request.post(BASE_URL + "/edit", carousel);
};

export const deleteCarousel = (carousel: Carousel) => {
  return request({
    url: BASE_URL + "/delete",
    method: "delete",
    data: carousel,
  });
};

export const activeCarousel = (carousel: Carousel) => {
  return request.post(BASE_URL + "/active", carousel);
};
export const queryActiveCarouselList = async (): Promise<Carousel[]> => {
  return request.get(BASE_URL + "/queryActiveList");
};
